from pydantic import BaseModel, Field
from typing import List, Literal, Optional


class ChatMessage(BaseModel):
    role: Literal["user", "assistant", "system"]
    content: str


class ChatBody(BaseModel):
    message: str
    history: Optional[List[ChatMessage]] = None
    conversation_id: Optional[int] = None
    user_id: Optional[int] = None


class ChatJsonPaser(BaseModel):
    input_message: str = Field(description="用户的输入文本")
    output_message: str = Field(description="翻译后的文本")